// app.js
const cloudService = require('./utils/cloud/cloudService.js')

App({
  onLaunch() {
    // 初始化云开发
    cloudService.initCloud()
    
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 检查云端登录状态
    if (cloudService.isCloudLoggedIn()) {
      console.log('用户已登录云端')
      this.globalData.cloudUserInfo = cloudService.getLocalCloudUserInfo()
    }
  },
  
  globalData: {
    userInfo: null,
    cloudUserInfo: null
  }
})
